package com.jb.repair.acticity;

import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import com.ab.activity.AbActivity;
import com.ab.util.AbDialogUtil;
import com.ab.view.wheel.AbWheelUtil;
import com.ab.view.wheel.AbWheelView;
import com.jb.repair.R;

public class TimeActivity extends AbActivity {
    private TextView timeTextView3 = null;
    private View mTimeView3 = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_time);
        timeTextView3 = (TextView)findViewById(R.id.measureTimeText3);
        timeTextView3.setOnClickListener(new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                mTimeView3 = mInflater.inflate(R.layout.choose_two, null);
                initWheelTime2(mTimeView3,timeTextView3);
                //第一个参数是弹出的布局，第二个参数是显示的位置
                AbDialogUtil.showDialog(mTimeView3, Gravity.BOTTOM);
            }

        });
    }
    public void initWheelTime2(View mTimeView, TextView mText){
        final AbWheelView mWheelViewMM = (AbWheelView)mTimeView.findViewById(R.id.wheelView1);
        final AbWheelView mWheelViewHH = (AbWheelView)mTimeView.findViewById(R.id.wheelView2);
        Button okBtn = (Button)mTimeView.findViewById(R.id.okBtn);
        Button cancelBtn = (Button)mTimeView.findViewById(R.id.cancelBtn);
        mWheelViewMM.setCenterSelectDrawable(this.getResources().getDrawable(R.drawable.wheel_select));
        mWheelViewHH.setCenterSelectDrawable(this.getResources().getDrawable(R.drawable.wheel_select));
        AbWheelUtil.initWheelTimePicker2(this, mText,mWheelViewMM, mWheelViewHH,okBtn,cancelBtn,1,1,true);
//        AbWheelUtil.initWheelTimePicker2(this, mText,mWheelViewMM, mWheelViewHH,okBtn,cancelBtn,23,23,false);
    }
}
